/**
 * 
 */
package vin.echo.core;

import java.lang.reflect.Field;

import vin.echo.core.annotation.Service;
import vin.echo.core.exception.EchoBuildExeception;

/**
 * @author Vin.Ma
 * 
 */
public class ContextUtils {
	public static String genFunctionKey(Class<?> claz, String funcName) {
		return funcName + "@" +claz.getName() ;
	}
	
	public static String getFiledKey(Class<?>claz,Field f){
		return  f.getName()+"@" +claz.getName();
	}
	
	public static String getServiceName(Class<?> clz) throws EchoBuildExeception{
		Service svcDesc = clz.getAnnotation(Service.class);
		if(svcDesc==null){
			throw new EchoBuildExeception();
		}
		
		return svcDesc.name();
		
	}
}
